using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using THSERP.BusinessEntities;
using THSERP.BaseProvider;
namespace THSERP.Modules.EmployeeConfig
{
    public class EmployeeConfigModule : BaseModuleERP
    {
        public EmployeeConfigModule()
        {
            Name = "EmployeeConfig";
            CurrentModuleEntity = new EmployeeConfigEntities();
            CurrentModuleEntity.Module = this;
            InitializeModule();
        }

        #region Levels Screen
        public void AddItemToHRLevelsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRLevelsList.AddObjectToList();
        }
        
        public void ChangeItemFromHRLevelsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRLevelsList.ChangeObjectFromList();
        }

        public void DeleteItemFromHRLevelsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRLevelsList.RemoveSelectedRowObjectFromList();
        }

        public void SaveHRLevelItems()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRLevelsList.SaveItemObjects(true);
            MessageBox.Show("Save successfully.", "#Message#", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        #endregion

        #region Positions Screen
        public void AddItemToHRPositionsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRPositionsList.AddObjectToList();
        }

        public void ChangeItemFromHRPositionsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRPositionsList.ChangeObjectFromList();
        }

        public void DeleteItemFromHRPositionsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRPositionsList.RemoveSelectedRowObjectFromList();
        }

        public void SaveHRPositionItems()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRPositionsList.SaveItemObjects(true);
            MessageBox.Show("Save successfully.", "#Message#", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        #endregion

        #region Departments Screen
        public void AddItemToHRDepartmentsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRDepartmentsList.AddObjectToList();
        }

        public void ChangeItemFromHRDepartmentsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRDepartmentsList.ChangeObjectFromList();
        }

        public void DeleteItemFromHRDepartmentsList()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRDepartmentsList.RemoveSelectedRowObjectFromList();
        }

        public void SaveHRDepartmentItems()
        {
            EmployeeConfigEntities entity = (EmployeeConfigEntities)CurrentModuleEntity;
            entity.HRDepartmentsList.SaveItemObjects(true);
            MessageBox.Show("Save successfully.", "#Message#", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        #endregion
    }
}
